package Test;
import cn.nawang.ebeim.uc.util.ConfigUtil;
/**
 * Copyright (c) 2008, 2012 Oracle and/or its affiliates.
 * All rights reserved. Use is subject to license terms.
 */
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.layout.*;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;


/**
 * Demonstrates a WebView object accessing a web page.
 *
 * @see javafx.scene.web.WebView
 * @see javafx.scene.web.WebEngine
 */
public class JavaFxBrowser extends Application {
    public static final String DEFAULT_URL = "http://127.0.0.1:" + ConfigUtil.getRestServerPort() + "/web/html/login.html";
    
    private void init(Stage primaryStage) {
        Group root = new Group();
        primaryStage.setScene(new Scene(root,1024,768));
        WebView webView = new WebView();
        
        final WebEngine webEngine = webView.getEngine();
        webEngine.load(DEFAULT_URL);
        
        
        VBox vBox = new VBox(1);
        vBox.getChildren().addAll(webView);
        VBox.setVgrow(webView, Priority.ALWAYS);

        root.getChildren().add(vBox);
    }

    @Override public void start(Stage primaryStage) throws Exception {
        init(primaryStage);
        primaryStage.show();
    }
    public static void main(String[] args) { 
      launch(args); }
}


